Function machinewrite(id)

Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.createTextfile("E:\vbs through write xml\NewXmlFile.xml", True)
    With f
        .Writeline "<root>"
    .Writeline "<element>"&id&"</element>"
    .Writeline "</root>"
        .Close
    End With

    Set xmlDom = CreateObject("Microsoft.XMLDOM")
    XmlDom.async = False
    XmlDom.Load("E:\vbs through write xml\NewXmlFile.xml")
XmlDom.Save("E:\vbs through write xml\NewXmlFile.xml")
End Function

Function machineread()

Dim objXML, Root, x

set objXML = CreateObject("Microsoft.XMLDOM")
 objXML.async = "false"
 objXML.load("E:\vbs through write xml\NewXmlFile.xml")
 Set Root = objXML.documentElement
 For Each x In Root.childNodes
 
if x.nodename="element" then
 plot=x.text
 msgbox plot
WScript.echo "hello"
 end if
WScript.echo "hello"
 
Next

End Function
Dim name
name="lll"
machinewrite(name)
machineread()
